package com.u17;

import java.util.Map;

/**
 * @author u17
 * https://leetcode-cn.com/problems/two-sum/
 */
public class Solution {

    public int[] twoSum(int[] nums, int target) {

        int [] arr = new int[2];

        for (int i = 0; i < nums.length - 1; i++) {
            for (int j = i + 1; j < nums.length; j++) {
                if (nums[i] + nums[j] == target) {
                   arr[0] = i;
                   arr[1] = j;
                }
            }
        }
        return arr;
    }


    public static void main(String[] args) {

        int[] nums = new int[]{3,3};

        int target = 6;

        Solution solution = new Solution();
        int[] ints = solution.twoSum(nums, target);
        for (int i = 0; i < ints.length; i++) {
            System.out.println(ints[i]);
        }

    }

}
